-
Notifications
You must be signed in to change notification settings - Fork 13.4k
-Zharden-sls flag (target modifier) added to enable mitigation against straight line speculation (SLS) #136597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
…t straight line speculation (SLS)
Some changes occurred in compiler/rustc_codegen_gcc |
First commit adds retpoline feature, but PR descriptions says about sls. |
Yes, first commit is in another PR #135927. |
Marking this as blocked on #135927 |
I filed an MCP for this flag: rust-lang/compiler-team#869 |
☔ The latest upstream changes (presumably #141232) made this pull request unmergeable. Please resolve the merge conflicts. |
#![feature(no_core, lang_items)] | ||
#![no_std] | ||
#![no_core] | ||
|
||
#[lang = "sized"] | ||
pub trait Sized {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use add-core-stubs, don't handwrite the minicore.
warning: target feature `retpoline-external-thunk` cannot be enabled with `-Ctarget-feature`: use `x86-retpoline` target modifier flag instead | ||
| | ||
= note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #116344 <https://github.com/rust-lang/rust/issues/116344> | ||
|
||
warning: 1 warning emitted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this possible at all?
//@ compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=lib | ||
//@ needs-llvm-components: x86 | ||
//@ [by_flag]compile-flags: -Zharden-sls=all | ||
//@ [by_feature]compile-flags: -Ctarget-feature=+harden-sls-ijmp,+harden-sls-ret |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should not be set by -Ctarget-feature
.
Flag (target modifier) to mitigate against straight line speculation (SLS).
-Zharden-sls=[none|all|return|indirect-jmp]
.The flag enables the related features:
+harden-sls-ijmp,+harden-sls-ret
.The flag is tracked as a target modifier to be equal between linked crates.
Tracking issue: #116851